//
//  PersonInfoModel.m
//  FD
//
//  Created by Yasin on 2018/10/24.
//  Copyright © 2018年 ZhiYuan Network. All rights reserved.
//  个人信息model

#import "PersonInfoModel.h"

@implementation PersonInfoModel
- (NSString *)head {
    return [NSString stringWithFormat:@"%@%@",kPicDomain,_head];
}

- (void)setBirthday:(NSNumber *)birthday {
    _birthday = birthday;
    
    //生日:年月日
   _birthdayStr = [self getDateStringWithTimeStr:[NSString stringWithFormat:@"%@",birthday]];
}


- (NSString *)description {
    NSArray *ptys = [PersonInfoModel rb_objPropeties];
    return [[self dictionaryWithValuesForKeys:ptys] description];
}


//12-3时间戳转时间
- (NSString *)getDateStringWithTimeStr:(NSString *)str {
//时间戳的长度是不确定的。
    
    //获取时间戳
    NSTimeInterval interval = [str doubleValue] / 1000;
    
//    344 707 200 000
    //时间戳转时间
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
    
    //NSDate 转 日期字符串
    
    NSDateFormatter *dateformate = [[NSDateFormatter alloc] init];
    [dateformate setDateFormat:@"yyyy-MM-dd"];
    
    NSString *dateStr = [dateformate stringFromDate:date];
    
    return dateStr;
}

@end
